﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sio.Mdm.Entities;

namespace IDM.Types
{
    [Sio.Mdm.Entities.Entity(
            "IDM.BF.AdministrationService.IRolesService, IDM.BF.IAdministrationService",
            TableName="Roles"
    )]
    public interface Role : IEntity
    {
        [Field] 
        int ID { get; set; }
        
        [Field] 
        string Name { get; set; }

        [SelfReferenceField(ReferenceField="ParentID")]
        Role Parent { get; set; }

        [Field(SelectMethod = "SelectChilds")]
        EntityCollection<Role> Childs { get; }

        [Field]
        DateTime Changed { get; set; }

        [Method]
        bool Destroy();
    }
}
